#include<iostream>
#include<string> 
#include<vector>
#include<maps>
using namespace std;

class Solution 
{
    const int L = 10;
public:
    vector<string> findRepeatedDnaSequences(string s) 
	{
        vector<string> ans;
        unordered_map<string, int> cnt;
        int n = s.length();
        for (int i = 0; i <= n - L; ++i) 
		{
            string sub = s.substr(i, L);
            if (++cnt[sub] == 2) 
			{
                ans.push_back(sub);
            }
        }
        return ans;
    }
};

int main()
{
	Solution s;
	s.	findRepeatedDnaSequences("DDDNNNAAA");
	return 0;
}
